//
//  NSString+SizeForFont.m
//  QQChatDemo
//
//  Created by zkingsoft on 16/1/11.
//  Copyright (c) 2016年 zkingsoft. All rights reserved.
//

#import "NSString+SizeForFont.h"

@implementation NSString (SizeForFont)

- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize
{
    NSDictionary *attrs = @{NSFontAttributeName : font};
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}


@end
